package cn.sdormitory.smartdor.dao;

import cn.sdormitory.basedata.entity.BStudent;
import cn.sdormitory.basedata.vo.BStudentListVo;
import cn.sdormitory.smartdor.entity.SdAttence;
import cn.sdormitory.smartdor.entity.SdWeekendAttence;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @className: SdWeekendAttenceDao
 * @author: Alex
 * @date: 2024/9/19
 **/
public interface SdWeekendAttenceDao extends BaseMapper<SdWeekendAttence> {
	
	/**
	 * 根据考勤时间和学生编号查询考勤信息
	 * @param accessDate
	 * @param studentNo
	 * @return
	 */
	List<SdWeekendAttence> getAttenceByDateAndStudentNo(@Param("accessDate") String accessDate, @Param("studentNo") String studentNo) ;
	
	
	/**
	 * 查询周末当天打卡情况
	 * @author alex
	 * @param: accessDate
	 * @date 2024/9/14 8:57
	 * @return
	 */
	List<SdWeekendAttence> getWeekendClockInData(@Param("accessDate") String accessDate);
	
	/**
	 * 批量插入
	 * @param sdAttendanceList
	 */
	void insertBatch(@Param("sdAttendanceList") List<SdWeekendAttence> sdAttendanceList);
	
	/**
	 * 根据宿舍考勤状态获取指定日期下指定用户所管辖的所有班级的学生名单
	 * @param userId
	 * @param accessDate
	 * @param attenceStatus
	 * @return
	 */
	List<BStudent> getClassUnderJurisdictionOfStuByStatus(@Param("userId")Long userId,
														  @Param("accessDate")String accessDate,
														  @Param("attenceStatus")String attenceStatus);
	
	List<BStudentListVo> getWeekendClockInStudentByCId(@Param("classId") Long classId, @Param("accessDate") String accessDate);
	
	// 根据时间段和学生id删除学生周末考勤请假数据
	void deleteWeekendLeaveAttenceInfo(@Param("studentNo") String studentNo,
									   @Param("startDate") String nowDate,
									   @Param("endDate") String endDate);
}
